﻿@using Kunlun.BusinessLogic;
@model IEnumerable<Kunlun.Models.Consumer_library>
@{
	ViewBag.Title = "相册管理";
}
@section Head{
	<link href="@Url.Content("~/Content/member/style.css")" rel="stylesheet" type="text/css" />
	<script type="text/javascript">
		$(function () {
			$(".RemoveLink").click(function () {

				var recordToDelete = $(this).attr("data-id");

				if (recordToDelete != '') {
					$.post("/MyPhoto/MyPhotoDel", { "id": recordToDelete },
                    function (data) {
                    	$('#row-' + recordToDelete).fadeOut('slow');

                    });
				}
			});

		});
	</script>
}
<div id="content">
	@Html.Partial("_MymenuPartial")
	<fieldset class="right">
		<legend>相册管理</legend>
		<p class="pu">
			<input type="button" class="buttonL" value="新增相册" onclick="location.href='/MyPhoto/MyPhotoAdd'" />
		</p>
		@foreach (var item in Model) {

			<ul id="row-@item.ID" class="mrxc">
				<li class="name">
					@Html.DisplayFor(modelItem => item.LibraryName)
				</li>
				<li class="img">
					@try {
						<a href="/MyPhoto/MyPhotoList/@item.ID">@KunlunHtml.Image(item.Consumer_pic.FirstOrDefault().ThumUrl, WebLog.PhotoView, item.Description);</a> 
	 } catch { 
            
						<img src="/content/images/no.png" />
	 }
				</li>
				<li class="edit">
					@Html.ActionLink("编辑", "MyPhotoEdit", new { id = item.ID }) |
					@Html.ActionLink("上传照片", "UploadFile", new { id = item.ID }) | <a href="#" class="RemoveLink" data-id=@item.ID>
						删除</a> </li>
			</ul>
  }
	</fieldset>
</div>
